const chatModel = require('../models/chat.model.js');

module.exports = {
    /**
     * 获取未发来新消息的聊天对象id
     */
    async getOldSender(formData) {
        let result = await chatModel.getOldSender(formData);
        return result;
    },
    /**
     * 获取发来新消息的聊天对象id
     */
    async getNewSender(formData) {
        let result = await chatModel.getNewSender(formData);
        return result;
    },
    /**
     * 获取聊天室id
     */
    async getRoom(formData) {
        let result = await chatModel.getRoom(formData);
        return result;
    },
    /**
     * 添加聊天室id
     */
    async addRoom(formData) {
        let result = await chatModel.addRoom(formData);
        return result;
    },
    /**
     * 添加聊天记录
     */
    async addMessage(formData) {
        let result = await chatModel.addMessage(formData);
        return result;
    },
    /**
     * 获取已读聊天记录
     * 
     */
    async getReadMessage(formData) {
        let result = await chatModel.getReadMessage(formData);
        return result;
    },    
    /**
    * 获取未读聊天记录
    * 
    */
   async getUnReadMessage(formData) {
       let result = await chatModel.getUnreadMessage(formData);
       return result;
   },
    /**
     * 修改聊天记录状态
     */
    async modifyMessageStates(formData) {
        let result = await chatModel.modifyMessageStates(formData);
        return result;
    }
}